package org.apak.control;

import java.util.HashMap;

public class ErrorList {
	private HashMap<String, String> errorList = new HashMap<String, String>();
	private Object object;
	
	public ErrorList(Object object) {
		this.object = object;
	}
	
	public void addError(String key, String message) {
		errorList.put(key, message);
	}
	
	public String getError(String key) {
		String message = errorList.get(key);
		if(message != null)
			return message;
		else
			return "";
	}
	
	public boolean isErrorFound() {
		if(errorList.size() > 0)
			return true;
		return false;
	}

	public Object getForm() {
		return this.object;
	}
}

